# Hello World Example
#
# Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!

import sensor, image, time

sensor.reset() # 初始化摄像头
sensor.set_pixformat(sensor.RGB565) # 格式为 RGB565.
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(10) # 跳过10帧，使新设置生效
while(True):
    img = sensor.snapshot()         # Take a picture and return the image.
    img.draw_line((20, 30, 40, 50))  #image.draw_line(line_tuple=(x0,y0,x1,y1), color=(r,g,b))
    img.draw_line((80, 50, 100, 100), color=(255,0,0))
    
#image.draw_rectangle(rect_tuple,color=White)在图像中画一个矩形框,rect_tuple的格式是(x, y, w, h)
    img.draw_rectangle((20, 30, 41, 51), color=(255,0,0))
    
#image.draw_circle(x, y, radius, color=White) 在图像中画一个圆
    img.draw_circle(50, 50, 30)
    
#image.draw_cross(x, y, size=5, color=White)
    img.draw_cross(90,60,size=10)
#image.draw_string(x, y, text, color=White)在图像中写字 8x10的像素,可以\n或\r换行
    img.draw_string(10,10, "hello world!")
